/*
 * @Author: ckk
 * @Date: 2022-11-14 13:14:36
 * @LastEditors: ckk
 * @LastEditTime: 2023-05-13 18:59:18
 * @Description: your project
 * @version: 1.0
 */

import axios from 'axios';
const myAxios = axios.create({});
myAxios.interceptors.request.use(config => {
  const token = localStorage.getItem('auth_token') ? JSON.parse(decodeURIComponent(localStorage.getItem('auth_token'))) : {};
  if (token.token_type) {
    const authorization = `${token.token_type} ${token.access_token}`;
    config.headers.Authorization = authorization;
  }
  return config;
},
error => {
  // Do something with request error
  return Promise.reject(error);
});
export default myAxios;
// export default axios;
